<?php
import("ORG.Util.Session");
// 本类由系统自动生成，仅供测试用途
class UserAction extends Action {

   private function checkLogin(){			//判断是否登陆 否则切到登陆界面
		session_start();
		if($_SESSION['online']==null){
			$this -> redirect('Login/index');
			exit;
		}
		return true;
	}
	public function index(){		//登陆
        $this->	checkLogin();
		$username=$_SESSION['online'];
		if($_SESSION['power']==0){
			$this->assign('username',$username);
			$this->assign('power','超级管理员');
			$this->display('index');
		}
		if($_SESSION['power']==1){
			$this->assign('username',$username);
			$this->assign('power','管理员');
			$this->display('index');
		}

    }
	public function logout()
	{
		$this->	checkLogin();
		Session::clear();
		$this->assign('jumpUrl','__APP__');
		$this->assign('waitSecond',2);
		$this->success('退出成功！');
	}
}